

# def double(x):
#     return x * 2
#
#
# def triple(x):
#     return x * 3
#
#
# def calc_number(func, x):
#     print(func(x))


# import time
#
#
# def timeit(f):
#
#     def wrapper(x):
#         start = time.time()
#         ret = f(x)
#         print(time.time() - start)
#         return ret
#
#     return wrapper
#
#
# @timeit
# def my_func(x):
#     time.sleep(x)
#     return 5
#
#
# print(my_func(1))


import time


def timeit(iteration):

    def inner(f):

        def wrapper(*args, **kwargs):
            start = time.time()
            for _ in range(iteration):
                ret = f(*args, **kwargs)
            print(time.time() - start)
            return ret
        return wrapper

    return inner


@timeit(1000)
def double(x):
    return x * 2


double(3)
